/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.mphokazi.designpatterns.part1.behavioral.chainofresponsibility;

/**
 *
 * @author Siya
 */
public class MainDriver {
    
    public static void main(String[] args) {
        PlanetHandler chain = setUpChain();
//Submit Reques t s
        chain.handleRequest(PlanetEnum.VENUS);
        chain.handleRequest(PlanetEnum.MERCURY);
        chain.handleRequest(PlanetEnum.EARTH);
        chain.handleRequest(PlanetEnum.JUPITER);
    }
    public static PlanetHandler setUpChain (){
        PlanetHandler mercuryHandler = new MercuryHandler();
        PlanetHandler venusHandler = new VenusHandler ();
        PlanetHandler earthHandler = new EarthHandler ();
        mercuryHandler.setSuccessor (venusHandler);
        venusHandler.setSuccessor (earthHandler);
        return mercuryHandler;
    }
}
